package com.mashibing.internalcommon.remote;

import com.mashibing.internalcommon.dto.Car;
import com.mashibing.internalcommon.dto.DriverCarBindingRelationship;
import com.mashibing.internalcommon.dto.DriverUser;
import com.mashibing.internalcommon.dto.ResponseResult;
import com.mashibing.internalcommon.request.DriverUserWorkStatus;
import com.mashibing.internalcommon.response.DriverUserExistsResponse;
import com.mashibing.internalcommon.response.OrderDriverResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "service-driver-user",path = "/service-driver-user")
public interface DriverUserClient {

    @RequestMapping(method = RequestMethod.POST, value = "/updateUser")
    ResponseResult updateUser(@RequestBody DriverUser driverUser);

    @RequestMapping(method = RequestMethod.GET, value = "/verificationDriverUser/{phoneNumber}")
    ResponseResult<DriverUserExistsResponse> verificationDriverUser(@PathVariable String phoneNumber);

    @RequestMapping(method = RequestMethod.GET, value = "/getDriverById/{carId}")
    ResponseResult<Car> getDriverById(@PathVariable String carId);

    @RequestMapping(method = RequestMethod.POST, value = "/updateStatus")
    ResponseResult updateStatus(@RequestBody DriverUserWorkStatus driverUserWorkStatus);

    @RequestMapping(method = RequestMethod.GET, value = "/getDriverCarRelationShip")
    ResponseResult<DriverCarBindingRelationship> getDriverCarRelationShip(@RequestParam String driverPhone);

    @RequestMapping(method = RequestMethod.GET, value = "/getDriverUserInfoByCarId/{carId}")
    ResponseResult<OrderDriverResponse> getDriverUserInfoByCarId(@PathVariable String carId);

    @RequestMapping(method = RequestMethod.POST,value = "/addUser")
    ResponseResult addUser(@RequestBody DriverUser driverUser);

    @RequestMapping(method = RequestMethod.POST,value = "/addCar")
    ResponseResult addCar(@RequestBody Car car);

    @RequestMapping(method = RequestMethod.POST,value = "//driver-car-binding-relationship/bind")
    ResponseResult bind(@RequestBody DriverCarBindingRelationship driverCarBindingRelationship);

    @RequestMapping(method = RequestMethod.GET,value = "/cityDriver/isAvailableDriver")
    ResponseResult<Boolean> isAvailableDriver(@RequestParam String cityCode);
}
